package com.prizedraw.prize_draw.controller;

import cn.hutool.core.lang.Assert;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.prizedraw.prize_draw.service.*;
import com.prizedraw.prize_draw.service.impl.DrawServiceImpl;
import com.prizedraw.prize_draw.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;

import javax.servlet.http.HttpServletRequest;

public class BaseController {
    @Autowired
    HttpServletRequest req;

    @Autowired
    RedisUtil redisUtil;

    @Autowired
    SysUserService sysUserService;

    @Autowired
    SysRoleService sysRoleService;

    @Autowired
    SysMenuService sysMenuService;

    @Autowired
    SysUserRoleService sysUserRoleService;

    @Autowired
    SysUserMenuService sysUserMenuService;

    @Autowired
    DrawService drawService;

    @Autowired
    DepartmentDrawService departmentDrawService;

    @Autowired
    PrizeService prizeService;

    @Autowired
    DrawRecordService drawRecordService;

    @Autowired
    DepartmentService departmentService;


    /**
     * 获取页面
     * @return
     */
    public Page getPage() {
        int current = ServletRequestUtils.getIntParameter(req, "current", 1);
        int size = ServletRequestUtils.getIntParameter(req, "size", 10);
        return new Page(current, size);
    }

}
